<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;

class EntrustSetupTables extends Migration
{
    /**
     * Run the migrations.
     *
     * @return  void
     */
    public function up()
    {
//        DB::beginTransaction();

        // Create table for storing roles
//        Schema::create('roles', function (Blueprint $table) {
//            $table->increments('id');
//            $table->string('name')->unique()->comment('权限编号');
//	        $table->integer('company_id')->comment('公司id');
//            $table->string('display_name')->nullable()->comment('角色名称');
//            $table->string('description')->nullable();
//            $table->timestamps();
//        });
//
//        // Create table for associating roles to users (Many-to-Many)
//        Schema::create('role_user', function (Blueprint $table) {
//            $table->integer('user_id')->unsigned();
//            $table->integer('role_id')->unsigned();
//            $table->primary(['user_id', 'role_id']);
//        });
//
//       // Create table for storing permissions
//        Schema::create('permissions', function (Blueprint $table) {
//            $table->increments('id');
//            $table->string('name')->unique();
//	        $table->integer('type')->comment('菜单：1是，null否')->nullable();
//	        $table->string('menu_name')->comment('菜单名称')->nullable();
//	        $table->string('menu_code')->comment('菜单码')->nullable();
//
//	        $table->string('display_name')->nullable();
//            $table->string('description')->nullable();
//            $table->timestamps();
//        });
////
////        // Create table for associating permissions to roles (Many-to-Many)
//        Schema::create('permission_role', function (Blueprint $table) {
//            $table->integer('permission_id')->unsigned();
//            $table->integer('role_id')->unsigned();
//            $table->primary(['permission_id', 'role_id']);
//        });
//        DB::commit();
    }

    /**
     * Reverse the migrations.
     *
     * @return  void
     */
    public function down()
    {
//        Schema::drop('permission_role');
//        Schema::drop('permissions');
//        Schema::drop('role_user');
//        Schema::drop('roles');
    }
}
